/**
 * Created by Administrator on 2017/6/27.
 */
var mongoose = require('../db/db');
var Schema = mongoose.Schema;

var CommentSchema = new Schema({
  movie: {
    type: Schema.Types.ObjectId,
    ref: 'Movie'
  },
  user: {
    type: Schema.Types.ObjectId,
    ref: 'User'
  },
  content: String,
  replies: [{
    user: {
      type: Schema.Types.ObjectId,
      ref: 'User'
    },
    content: String,
    time: Date
  }],
  time: Date
});

module.exports = CommentSchema;